/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Database;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author owner
 */
public class Create_Barang {
    public static void main(String[] args) throws SQLException, FileNotFoundException, IOException {
        Connection con;
        con = Koneksi.open();
        Statement stat = con.createStatement();

        String buat = "CREATE TABLE BARANG_T (NO_RESI VARCHAR2(16) CONSTRAINT brgT_no_pk PRIMARY KEY,"
                +"BIAYA VARCHAR2(8),"
                +"JENIS_BARANG VARCHAR2(3),"
                +"BOBOT VARCHAR2 (5),"
                +"ID_KANTOR_CABANG VARCHAR2(6) CONSTRAINT brgT_id_fk REFERENCES KANTOR_CABANG_T(ID_KANTOR_CABANG),"
                +"TANGGAL_KIRIM VARCHAR2(10),"
                +"TANGGAL_TERIMA VARCHAR2(10),"
                +"STATUS VARCHAR2(4))";
        stat.executeQuery(buat);
        System.out.println("table BARANG_T created");
    }
}
